package com.scoressystem.service.impl;

import com.scoressystem.mapper.ScoresMapper;
import com.scoressystem.pojo.Scores;
import com.scoressystem.pojo.Subjects;
import com.scoressystem.service.ScoresService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.Map;


@Service
public class ScoresServiceImpl implements ScoresService {

    @Resource
    private ScoresMapper scoresMapper;

    @Override
    public List<Scores> selectAllScoresByPage(Map<String, Object> map) {
        return scoresMapper.selectAllScoresByPage(map);
    }

    @Override
    public long selectAllScoresCount(Map<String, Object> map) {
        return scoresMapper.selectAllScoresCount(map);
    }

    @Override
    public int deleteScoreById(Integer id) {
        return scoresMapper.deleteScoreById(id);
    }

    @Override
    public List<Scores> getAllScoresBySname(String SName) {
        return scoresMapper.getAllScoresBySname(SName);
    }

    @Override
    public int addScore(Scores Score) {
        return scoresMapper.addScore(Score);
    }

    @Override
    public Scores getScoreById(Integer id) {
        return scoresMapper.getScoreById(id);
    }

    @Override
    public int updateScore(Scores score) {
        return scoresMapper.updateScore(score);
    }

    @Override
    public Scores getScoreByStuIdAndSubId(Integer stuId, Integer subId) {
        return scoresMapper.getScoreByStuIdAndSubId(stuId, subId);
    }

    @Override
    public double getScoresByStuId(Integer stuId) {
        return scoresMapper.getScoresByStuId(stuId);
    }

    @Override
    public List<Scores> getMyAllSubjectsByStuId(Integer stuId) {
        return scoresMapper.getMyAllSubjectsByStuId(stuId);
    }
}
